package Graph;

public class Test {
    public static void main(String[] args) {
        String str = "abcdefghi";
        char[] array =str.toCharArray();
        Graph g = new Graph(str.length(),false);
        g.initGraph(array);

        g.addEdge('a', 'b', 4);
        g.addEdge('a', 'h', 8);
        //g.addEdge('a', 'h', 9);
        g.addEdge('b', 'c', 8);
        g.addEdge('b', 'h', 11);
        g.addEdge('c', 'i', 2);
        g.addEdge('c', 'f', 4);
        g.addEdge('c', 'd', 7);
        g.addEdge('d', 'f', 14);
        g.addEdge('d', 'e', 9);
        g.addEdge('e', 'f', 10);
        g.addEdge('f', 'g', 2);
        g.addEdge('g', 'h', 1);
        g.addEdge('g', 'i', 6);
        g.addEdge('h', 'i', 7);

        Graph  primTree = new Graph(str.length(),false);
        System.out.println(g.kruskal(primTree));
    }
}
